package it.okkam.longwell.ui.command;

import javax.servlet.ServletException;

import org.apache.velocity.VelocityContext;

import edu.mit.simile.longwell.ui.FlairMessage;
import edu.mit.simile.longwell.ui.InjectionManager;
import edu.mit.simile.longwell.ui.command.CommandBase;

public class UserRegistrationBasicCommand extends CommandBase{
	final protected String m_template;
	VelocityContext vcContext = null;
	public UserRegistrationBasicCommand(InjectionManager injectionManager, String template) {
		super(injectionManager);
		m_template = template;
	}

	@Override
	public void execute(FlairMessage msg) throws ServletException {
		try {
			vcContext = createContext(msg);
			msg.m_ve.mergeTemplate(
					m_template,
					vcContext,
					msg.m_response.getWriter());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
